package com.ae.shield.common.enchantment.shieldSuffix;

import net.minecraft.enchantment.Enchantment;

import javax.annotation.Nonnull;

public class LowFrequency extends SuffixBase {
    public LowFrequency() {
        super(new SuffixRate()
                .piles(0.5f, 2)
                .intensity(2f, 2));
    }

    @Override
    public float levelRate(int level, SuffixProperty property, float rate) {
        switch (property) {
            case PILES:
                return rate - (level - 1 )* 0.2f;
            case INTENSITY:
                return rate + (level - 1) * 0.25f;
        }
        return super.levelRate(level, property, rate);
    }

    @Override
    protected boolean canApplyTogether(@Nonnull Enchantment enchantment) {
        return enchantment != SuffixList.HIGH_FREQUENCY.get() && super.canApplyTogether(enchantment);
    }
}
